<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>绝对定位</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            border: 1px solid red;
        }
        .parent{
            width: 400px;
            height: 400px;
            border: 1px solid red;
            position: relative;
            left: 100px;
            top: 100px;

        }
        .child{
            position: absolute;
            top: -5px;
        }
    </style>
</head>
<body>
<div class="parent">
    <div class="child">

    </div>
</div>
</body>
</html>